<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>拉萨市财政局投资评审管理系统  </title>
  <link rel="stylesheet" href="css/style.css">
</head>
<body>
<!--main-header start-->

<!--main-header end-->
<!--modify-password start-->
<div class="modify-password-wrap">
  <div class="modify-password w-1200">
    <div class="modify-password-tit">修改密码</div>
    <!--modify-password-bd start-->
    <div class="modify-password-bd">
      <div class="modify-password-li clearfix">
        <div class="label">用户名：</div>
        <div class="input" id="user">mumu-li</div>
      </div>
      <div class="modify-password-li clearfix">
        <div class="label">原始密码：</div>
        <div class="input">
          <input type="text" id="old" placeholder="">
        </div>
      </div>
      <div class="modify-password-li clearfix">
        <div class="label">新密码：</div>
        <div class="input">
          <input type="text" id="new1" placeholder="">
        </div>
      </div>
      <div class="modify-password-li clearfix">
        <div class="label">确认新密码：</div>
        <div class="input">
          <input type="text"  id="new2" placeholder="">
        </div>
      </div>
      <div class="modify-password-bot">
        <button class="login-btn" onclick="editpwd()">确认修改</button>
      </div>
    </div>
    <!--modify-password-bd end-->
  </div>
</div>
<!--modify-password end-->
<script src="js/auth.js"></script>

<script>
  

function editpwd(){
  var old = $("#old").val();
  var new1 = $("#new1").val();
  var new2 =  $("#new2").val();

  if(old == ''|| new1 == '' || new2 == ''){

    alert("请检查所填信息，每项信息必须填写");
    return false;
  }


  if(new1 != new2){
    alert("两次密码不一致");
    return false;
  }


  $.post(HTTP_HOST+"api/Auth/editpwd",{"old":old,"new":new1},function(res){

      if(res.result.code==200){
        alert(res.result.msg);
        window.location.reload();
      }else{
        alert(res.result.msg);
      }



  },'JSON');

}





</script>
</body>
</html>